<?php require _APP_PATH_ . '/system/platform/resource/common_inc_header.tpl.php';?>

<span class="layui-breadcrumb">
    <a href="<?php echo url( _MODULE_NAME_ . '/admin.index/index');?>"><?php echo $GLOBALS['config']['module']['name'];?></a>
    <a><cite>首页</cite></a>
</span>
<br><br>

<div class="layui-card">
    <!-- <div class="layui-card-header"></div> -->
    <div class="layui-card-body">
        
        <div style="padding: 10px;text-align:center ">
            <img src="<?php echo url( 'api/help/qrcode',['text'=> url([_MODULE_NAME_ ,'index','index']) ] );?>" style="width:100px;">
            入口链接:
            <a href="<?php echo  url( [ _MODULE_NAME_ ,'index','index'] );?>" target="_blank">
                <?php echo  url( [ _MODULE_NAME_ ,'index','index'] );?>
            </a>
        </div>
        
    </div>
</div>

<div class="layui-row layui-col-space15">
    <div class="layui-col-sm6 layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">
                发布文章
                <span class="layui-badge layui-bg-orange" style="position: absolute;right: 15px; top: 12px;">文章</span>
            </div>
            <div class="layui-card-body">
				<p style="font-size: 36px;color: #666;line-height: 36px;padding: 5px 0 10px;text-align:center"><?php echo $tongji['article']['fabu'];?></p>
				<p>
					文章总数量
					<span style="position: absolute;right: 15px;"><?php echo $tongji['article']['zong'];?> 篇</span>
				</p>
            </div>
        </div>

        <div class="layui-card">
            <div class="layui-card-header">
            分类文章统计
            <span class="layui-badge layui-bg-orange" style="position: absolute;right: 15px; top: 12px;">文章</span>
            </div>
            <div class="layui-card-body">

                <div id="chart_article" style="width:100%;height:200px"></div>
                <script type="text/javascript">
                    var myChart = echarts.init(document.getElementById('chart_article'),'light');
                    // 指定图表的配置项和数据
                    var option = {
                        title: {},
                        tooltip: {},
                        legend: {
                            type: 'scroll',
                            orient: 'vertical',
                            right: 10,
                            top: 20,
                            bottom: 20
                        },
                        series: [{
                            type: 'pie',
                            data: <?php echo json_encode($rs_chart_article)?>
                        }]
                    };
                    myChart.setOption(option);
                </script>

            </div>
        </div>

    </div>

    <div class="layui-col-sm6 layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">
                发布商品
                <span class="layui-badge layui-bg-blue" style="position: absolute;right: 15px; top: 12px;">商品</span>
            </div>
            <div class="layui-card-body">
            <p style="font-size: 36px;color: #666;line-height: 36px;padding: 5px 0 10px;text-align:center"><?php echo $tongji['goods']['fabu'];?></p>
            <p>
                商品总数量
                <span style="position: absolute;right: 15px;"><?php echo $tongji['goods']['zong'];?> 个</span>
            </p>
            </div>
        </div>

        <div class="layui-card">
            <div class="layui-card-header">
            分类商品统计
            <span class="layui-badge layui-bg-blue" style="position: absolute;right: 15px; top: 12px;">商品</span>
            </div>
            <div class="layui-card-body">

                <div id="chart_goods" style="width:100%;height:200px"></div>
                <script type="text/javascript">
                    var myChart = echarts.init(document.getElementById('chart_goods'));
                    // 指定图表的配置项和数据
                    var option = {
                        title: {},
                        tooltip: {},
                        legend: {
                            type: 'scroll',
                            orient: 'vertical',
                            right: 10,
                            top: 20,
                            bottom: 20
                        },
                        series: [{
                            type: 'pie',
                            data: <?php echo json_encode($rs_chart_goods)?>
                        }]
                    };
                    myChart.setOption(option);
                </script>

            </div>
        </div>

    </div>

    <div class="layui-col-sm12 layui-col-md12">

        <div class="layui-card">
            <div class="layui-card-header">
            访问量统计
            <span class="layui-badge layui-bg-blue" style="position: absolute;right: 15px; top: 12px;">30日</span>
            </div>
            <div class="layui-card-body">

                <div id="chart_hit" style="width:100%;height:300px"></div>
                <script type="text/javascript">
                    var myChart = echarts.init(document.getElementById('chart_hit'),'light');
                    // 指定图表的配置项和数据
                    var option = {
                        title: {},
                        tooltip: {
                            trigger: 'axis',
                        },
                        legend: { show:false },
                        xAxis: {
                            type: 'category',
                            data: <?php echo $date_str;?>
                        },
                        yAxis: {
                            type: 'value',
                            minInterval: 1
                        },
                        series: [{
                            type: 'line',
                            name: '访问量',
                            data: <?php echo $count_str;?>
                        }]
                    };
                    myChart.setOption(option);
                </script>

            </div>
        </div>

    </div>


</div>



<?php require _APP_PATH_ . '/system/platform/resource/common_inc_footer.tpl.php';?>